package com.feather.common.web;

import java.io.IOException;
import java.util.zip.GZIPInputStream;

import javax.servlet.ReadListener;
import javax.servlet.ServletInputStream;

/**
 * @author flogyin
 */
public class GzipServletInputStream extends ServletInputStream {
	protected GZIPInputStream	gzipInputStream;

	public GzipServletInputStream() {

	}

	public GzipServletInputStream(GZIPInputStream stream) {
		this.gzipInputStream = stream;
	}

	@Override
	public boolean isFinished() {
		return true;
	}

	@Override
	public boolean isReady() {
		return true;
	}

	@Override
	public void setReadListener(ReadListener arg0) {

	}

	@Override
	public int read() throws IOException {
		return this.gzipInputStream.read();
	}
}
